/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#include "TerrainTextureManager.h"

#include <QtCore/QFileInfoList>
#include <QtCore/QDir>
#include <QtGui/QImage>

namespace PQBuilder
{

	TerrainTextureManager::TerrainTextureManager()
	{

		QDir dir("texture");

		dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
		dir.setSorting(QDir::Size | QDir::Reversed);

		QFileInfoList list = dir.entryInfoList();

		int cnt=list.size();
		for (int i=0;i<cnt;++i){
			
			QString path=list[i].absoluteFilePath();


			QStringList l=path.split(".");
			int size=l.size();
			QString ext=l[size-1];

			if(ext=="png"||ext=="PNG"){
				QFileInfo info=list[i];
				_texfiles.push_back(info);
			}
			
			
		}
		//list.
		
		

	}

}
